package com.x.Part9_继承;

import java.util.concurrent.PriorityBlockingQueue;

/**
 * ClassName: ManKind
 * Package: IntelliJ IDEA
 * Description:
 * Written by HanXu
 * Create 2024.02.27 20:38
 */
public class ManKind {
    private int salary;
    private int sex;

    public ManKind(){}

    public ManKind(int salary,int sex){
        this.salary=salary;
        this.sex=sex;
    }

    public int getSalary() {
        return salary;
    }

    public void setSalary(int salary) {
        this.salary = salary;
    }

    public int getSex() {
        return sex;
    }

    public void setSex(int sex) {
        this.sex = sex;
    }

    public void manOrWomen(int sex){
        if(sex==1){
            System.out.println("男人");
        }else if(sex==0){
            System.out.println("女人");
        }else{
            System.out.println("人妖");
        }
    }

    public void workOrRest(){
        if(getSalary()>0)
            System.out.println("工作");
        else if(getSalary()==0)
            System.out.println("休息");
        else
            System.out.println("负债");
    }
}
